package com.joeyzh.base;

import com.joey.ui.general.BaseFragment;
import com.joeyzh.base.MvvmCreateDelegate;

/**
 * Created by Joey on 2018/12/4.
 *
 * @author by Joey
 */

public abstract class BaseMvvmFragment<Entity, VM extends IViewModel<Entity>, PT extends IPresenter<VM>> extends BaseFragment implements  MvvmCreateDelegate<Entity, VM, PT> {

    protected PT presenter;
    protected VM viewModel;
    protected Entity entity;

    @Override
    public void initData() {
        entity = getEntity();
        viewModel = createViewModel(entity);
        presenter = createPresenter(viewModel);
    }

}
